<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<html>
	<head>
		<title>ϵͳ</title>
		<%@ include file="/commons/meta.jsp"%>

	</head>

	<body>
		<table width="100%" height="100%" border="0" cellpadding="0"
			cellspacing="0">
			<tr>
				<td align="center" valign="top">
					<div id="position">
						当前位置：系统管理 - 子流程管理
					</div>
					<form name="form1" method="post" action="">
						<font color="red">${msg }</font>
						<input type=hidden name=flowClassId value=${flowClassId }>
						<table width="95%" border="0" cellspacing="2" cellpadding="2">
							<tr>
								<td>
									<input type="button" name="Submit22" value="返回"
										onClick="javascript:doReturn()">
									<input type="button" name="Submit22" value="添加子流程"
										onClick="javascript:add()">
									<input type="button" name="Submit22" value="上升"
										onClick="javascript:doAbove()">
									<input type="button" name="Submit22" value="下降"
										onClick="javascript:doDown()">
									<input type="button" name="Submit22" value="添加审核权限"
										onClick="javascript:doAudit()">
								</td>
							</tr>
						</table>
						<table width="95%" cellpadding="2" cellspacing="1"
							bgcolor="#CEEFFF">
							<tr>
								<td class="listtitle">
									&nbsp;
								</td>
								<td class="listtitle">
									名称&nbsp;
								</td>
								<td class="listtitle">
									状态&nbsp;
								</td>
								<td class="listtitle">
									备注&nbsp;
								</td>
								<td class="listtitle">
									排序&nbsp;
								</td>
								<td class="listtitle">
									是否审核&nbsp;
								</td>
								<td class="listtitle" width="15%">
									&nbsp;
								</td>
							</tr>
							<s:iterator value="page.list">
								<tr>
									<td bgcolor="#FFFFFF">
										<input type="checkbox" name="id" value="${id}">
										&nbsp;
									</td>
									<td bgcolor="#FFFFFF">
										${name}&nbsp;
									</td>
									<td bgcolor="#FFFFFF">
										<s:if test="status==FLOW_STATUS_START">开始</s:if>
										<s:if test="status==FLOW_STATUS_PRO">过程</s:if>
										<s:if test="status==FLOW_STATUS_END">结束</s:if>
										&nbsp;
									</td>
									<td bgcolor="#FFFFFF">
										${memo}&nbsp;
									</td>
									<td bgcolor="#FFFFFF">
										${order}&nbsp;
									</td>
									<td bgcolor="#FFFFFF">
										<s:if test="audit == AUDIT_YES">审核</s:if>
										<s:if test="audit == AUDIT_NO">不审核</s:if>
										&nbsp;
									</td>
									<td bgcolor="#FFFFFF" width="25%">
										<a
											href="${ctx}/workorder/flow!view.action?id=${id}&flowClassId=${flowClassId}">预
											览</a>&nbsp;
										<a
											href="${ctx}/workorder/flow!update.action?id=${id}&flowClassId=${flowClassId}">修
											改</a>&nbsp;
										<a
											href="${ctx}/workorder/flow!delete.action?id=${id}&flowClassId=${flowClassId}">删
											除</a>&nbsp;
										<a
											href="${ctx}/workorder/flow!fieldClass.action?id=${id}&flowId=${id}&flowClassId=${flowClassId }">绑定表单</a>&nbsp;
									</td>
								</tr>
							</s:iterator>
						</table>
					</form>
				</td>
			</tr>
		</table>
	</body>
</html>
<script language="javascript" type="text/javascript">
 	 		//分页查询浏览
            function query(pageIndex)
            {
               	${'form1'}.action = "${ctx}/workorder/workOrder.action";
               	${'form1'}.submit();
            }  
            function doAbove()
            {
            	var ids = ${'form1'}.id;
            	var tag = 0 ;
            	if(ids.length==1)
            	{
            		if(ids.checked==true)
            		{
            			tag++;
            		}
            	}else if(ids.length>1)
            	{
            		for(var i=0;i<ids.length;i++)
            		{
            			if(ids[i].checked==true)
            		{
            			tag++;
            		}
            		}
            	}
            	if(tag!=1)
            	{
            		alert("请选择一个流程！");
            		return false;
            	}
            	
            	${'form1'}.action = "${ctx}/workorder/flow!above.action";
               	${'form1'}.submit();
            }
            function doDown()
            {
            	var ids = ${'form1'}.id;
            	var tag = 0 ;
            	if(ids.length==1)
            	{
            		if(ids.checked==true)
            		{
            			tag++;
            		}
            	}else if(ids.length>1)
            	{
            		for(var i=0;i<ids.length;i++)
            		{
            			if(ids[i].checked==true)
            		{
            			tag++;
            		}
            		}
            	}
            	if(tag!=1)
            	{
            		alert("请选择一个流程！");
            		return false;
            	}
            	${'form1'}.action = "${ctx}/workorder/flow!down.action";
               	${'form1'}.submit();
            }
            
             function doAudit()
            {
            	var ids = ${'form1'}.id;
            	var tag = 0 ;
            	if(ids.length==1)
            	{
            		if(ids.checked==true)
            		{
            			tag++;
            		}
            	}else if(ids.length>1)
            	{
            		for(var i=0;i<ids.length;i++)
            		{
            			if(ids[i].checked==true)
            		{
            			tag++;
            		}
            		}
            	}
            	if(tag!=1)
            	{
            		alert("请选择一个流程！");
            		return false;
            	}
            	${'form1'}.action = "${ctx}/workorder/flow!audit.action";
               	${'form1'}.submit();
            }
            
            function add()
            {
            	${'form1'}.action = "${ctx}/workorder/flow!input.action";
               	${'form1'}.submit();
            }
            function doReturn()
            {
            	${'form1'}.action = "${ctx}/workorder/flowClass.action";
               	${'form1'}.submit();
            }
</script>
